package reflectstudy;

public class Test04 {
    public static void main(String[] args) {
        // 获取字节码信息
        Class<Student> studentClass = Student.class;

        // 获取运行时类的接口
        Class<?>[] interfaces = studentClass.getInterfaces();
        for (Class c : interfaces) {
            System.out.println(c);
        }


        // 获取父类字节码信息
        Class<? super Student> superclass = studentClass.getSuperclass();
        Class<?>[] interfaces1 = superclass.getInterfaces();
        for (Class<?> aClass : interfaces1) {
            System.out.println(aClass);
        }

        // 获取运行时类所在的包
        Package aPackage = studentClass.getPackage();
        System.out.println(aPackage);
        System.out.println(aPackage.getName());

    }
}
